#pragma once

#include <vector>
#include "MapTile.h"

namespace pathfinding
{
	class Map
	{
	public:
		Map();
		virtual ~Map();

		MapTile getTile(int x, int y) const;
		void setTileType(int x, int y, TileType tileType);

		const IntRect& getRect() const;
		void setRect(const IntRect& rect);

		bool isPassable(int x, int y) const;

		bool findPath( const IntPoint& start, const IntPoint& end, std::vector<IntPoint>* path );
	protected:
		MapTile* getTilePtr(int x, int y) const;

		typedef MapTile* PMapTile;
		typedef PMapTile* PPMapTile;
		
		IntRect _rect;	
		PPMapTile _map[4];
	};

}